package com.adan.auth.controller;

import com.adan.auth.model.dto.CheckCodeDto;
import com.adan.auth.service.VerifyCodeService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @version: 1.0
 * @Author: adan
 * @description: 找回密码
 * @date: 2023-06-24 23:36
 */
@Slf4j
@RestController
public class VerifyCodeController {

    @Autowired
    private VerifyCodeService verifyCodeService;

    @ApiOperation("找回密码")
    @PostMapping("/findpassword")
    public String findpassword(@RequestBody CheckCodeDto checkCode){
        boolean update = verifyCodeService.updatePassword(checkCode);
        if (update){
            return "修改成功";
        }
        return "修改失败";

    }

}
